gdk_broadway_surface_move_resize (surface, TRUE, x, y, -1, -1);
}
+static void
+gdk_broadway_surface_moved_to_rect (GdkSurface *surface,
+ GdkRectangle final_rect)
+{
+ GdkSurface *toplevel;
+ int x, y;
+
+ if (surface->surface_type == GDK_SURFACE_POPUP)
+ toplevel = surface->parent;
+ else
+ toplevel = surface->transient_for;
+
+ gdk_surface_get_origin (toplevel, &x, &y);
+ x += final_rect.x;
+ y += final_rect.y;
+
+ if (final_rect.width != surface->width ||
+ final_rect.height != surface->height)
+ {
+ gdk_broadway_surface_move_resize (surface,
+ TRUE,
+ x, y,
+ final_rect.width, final_rect.height);
+ }
+ else
+ {
+ gdk_broadway_surface_move (surface, x, y);
+ }
+}
+
+static void
+gdk_broadway_surface_move_to_rect (GdkSurface *surface,
+ const GdkRectangle *rect,
+ GdkGravity rect_anchor,
+ GdkGravity surface_anchor,
+ GdkAnchorHints anchor_hints,
+ gint rect_anchor_dx,
+ gint rect_anchor_dy)
+{
+ gdk_surface_move_to_rect_helper (surface,
+ rect,
+ rect_anchor,
+ surface_anchor,
+ anchor_hints,
+ rect_anchor_dx,
+ rect_anchor_dy,
+ gdk_broadway_surface_moved_to_rect);
+}
+
static void
gdk_broadway_surface_raise (GdkSurface *surface)
{
impl_class->restack_toplevel = gdk_broadway_surface_restack_toplevel;
impl_class->move_resize = gdk_broadway_surface_move_resize;
impl_class->toplevel_resize = gdk_broadway_surface_toplevel_resize;
+ impl_class->move_to_rect = gdk_broadway_surface_move_to_rect;
impl_class->get_geometry = gdk_broadway_surface_get_geometry;
impl_class->get_root_coords = gdk_broadway_surface_get_root_coords;
impl_class->get_device_state = gdk_broadway_surface_get_device_state;
return primary;
}
-static void
-gdk_surface_real_move_to_rect (GdkSurface *surface,
- const GdkRectangle *rect,
- GdkGravity rect_anchor,
- GdkGravity surface_anchor,
- GdkAnchorHints anchor_hints,
- gint rect_anchor_dx,
- gint rect_anchor_dy)
+void
+gdk_surface_move_to_rect_helper (GdkSurface *surface,
+ const GdkRectangle *rect,
+ GdkGravity rect_anchor,
+ GdkGravity surface_anchor,
+ GdkAnchorHints anchor_hints,
+ gint rect_anchor_dx,
+ gint rect_anchor_dy,
+ GdkSurfaceMovedToRect moved_to_rect)
{
GdkSurface *toplevel;
GdkDisplay *display;
final_rect.width += surface->shadow_left + surface->shadow_right;
final_rect.height += surface->shadow_top + surface->shadow_bottom;
- if (final_rect.width != surface->width || final_rect.height != surface->height)
- gdk_surface_move_resize (surface, final_rect.x, final_rect.y, final_rect.width, final_rect.height);
- else
- gdk_surface_move_resize_internal (surface, TRUE, final_rect.x, final_rect.y, -1, -1);
-
gdk_surface_get_origin (toplevel, &x, &y);
final_rect.x -= x;
final_rect.y -= y;
flipped_rect.x -= x;
flipped_rect.y -= y;
+ moved_to_rect (surface, final_rect);
+
g_signal_emit_by_name (surface,
"moved-to-rect",
&flipped_rect,
object_class->get_property = gdk_surface_get_property;
klass->beep = gdk_surface_real_beep;
- klass->move_to_rect = gdk_surface_real_move_to_rect;
/**
* GdkSurface:cursor:
void gdk_surface_set_state (GdkSurface *surface,
GdkSurfaceState new_state);
+typedef void (* GdkSurfaceMovedToRect) (GdkSurface *surface,
+ GdkRectangle final_rect);
+
+void
+gdk_surface_move_to_rect_helper (GdkSurface *surface,
+ const GdkRectangle *rect,
+ GdkGravity rect_anchor,
+ GdkGravity surface_anchor,
+ GdkAnchorHints anchor_hints,
+ gint rect_anchor_dx,
+ gint rect_anchor_dy,
+ GdkSurfaceMovedToRect moved_to_rect);
+
G_END_DECLS
#endif /* __GDK_SURFACE_PRIVATE_H__ */
window_quartz_resize (window, width, height);
}
+static void
+gdk_quartz_surface_moved_to_rect (GdkSurface *surface,
+ GdkRectangle final_rect)
+{
+ GdkSurface *toplevel;
+ int x, y;
+
+ if (surface->surface_type == GDK_SURFACE_POPUP)
+ toplevel = surface->parent;
+ else
+ toplevel = surface->transient_for;
+
+ gdk_surface_get_origin (toplevel, &x, &y);
+ x += final_rect.x;
+ y += final_rect.y;
+
+ if (final_rect.width != surface->width ||
+ final_rect.height != surface->height)
+ {
+ window_quartz_move_resize (surface,
+ x, y,
+ final_rect.width, final_rect.height);
+ }
+ else
+ {
+ window_quartz_resize (surface, final_rect.width, final_rect.height);
+ }
+}
+
+static void
+gdk_quartz_surface_move_to_rect (GdkSurface *surface,
+ const GdkRectangle *rect,
+ GdkGravity rect_anchor,
+ GdkGravity surface_anchor,
+ GdkAnchorHints anchor_hints,
+ gint rect_anchor_dx,
+ gint rect_anchor_dy)
+{
+ gdk_surface_move_to_rect_helper (surface,
+ rect,
+ rect_anchor,
+ surface_anchor,
+ anchor_hints,
+ rect_anchor_dx,
+ rect_anchor_dy,
+ gdk_quartz_surface_moved_to_rect);
+}
+
/* Get the toplevel ordering from NSApp and update our own list. We do
* this on demand since the NSApp’s list is not up to date directly
* after we get windowDidBecomeMain.
impl_class->restack_toplevel = gdk_surface_quartz_restack_toplevel;
impl_class->move_resize = gdk_surface_quartz_move_resize;
impl_class->toplevel_resize = gdk_surface_quartz_toplevel_resize;
+ impl_class->move_to_rect = gdk_surface_quartz_move_to_rect;
impl_class->get_geometry = gdk_surface_quartz_get_geometry;
impl_class->get_root_coords = gdk_surface_quartz_get_root_coords;
impl_class->get_device_state = gdk_surface_quartz_get_device_state;
gdk_win32_surface_move_resize (surface, TRUE, x, y, -1, -1);
}
+static void
+gdk_win32_surface_moved_to_rect (GdkSurface *surface,
+ GdkRectangle final_rect)
+{
+ GdkSurface *toplevel;
+ int x, y;
+
+ if (surface->surface_type == GDK_SURFACE_POPUP)
+ toplevel = surface->parent;
+ else
+ toplevel = surface->transient_for;
+
+ gdk_surface_get_origin (toplevel, &x, &y);
+ x += final_rect.x;
+ y += final_rect.y;
+
+ if (final_rect.width != surface->width ||
+ final_rect.height != surface->height)
+ {
+ gdk_win32_surface_move_resize (surface,
+ TRUE,
+ x, y,
+ final_rect.width, final_rect.height);
+ }
+ else
+ {
+ gdk_win32_surface_move (surface, x, y);
+ }
+}
+
+static void
+gdk_win32_surface_move_to_rect (GdkSurface *surface,
+ const GdkRectangle *rect,
+ GdkGravity rect_anchor,
+ GdkGravity surface_anchor,
+ GdkAnchorHints anchor_hints,
+ gint rect_anchor_dx,
+ gint rect_anchor_dy)
+{
+ gdk_surface_move_to_rect_helper (surface,
+ rect,
+ rect_anchor,
+ surface_anchor,
+ anchor_hints,
+ rect_anchor_dx,
+ rect_anchor_dy,
+ gdk_win32_surface_moved_to_rect);
+}
+
static void
gdk_win32_surface_raise (GdkSurface *window)
{
impl_class->restack_toplevel = gdk_win32_surface_restack_toplevel;
impl_class->move_resize = gdk_win32_surface_move_resize;
impl_class->toplevel_resize = gdk_win32_surface_toplevel_resize;
+ impl_class->move_to_rect = gdk_win32_surface_move_to_rect;
impl_class->get_geometry = gdk_win32_surface_get_geometry;
impl_class->get_device_state = gdk_surface_win32_get_device_state;
impl_class->get_root_coords = gdk_win32_surface_get_root_coords;
gdk_x11_surface_move_resize (surface, TRUE, x, y, -1, -1);
}
+static void
+gdk_x11_surface_moved_to_rect (GdkSurface *surface,
+ GdkRectangle final_rect)
+{
+ GdkSurface *toplevel;
+ int x, y;
+
+ if (surface->surface_type == GDK_SURFACE_POPUP)
+ toplevel = surface->parent;
+ else
+ toplevel = surface->transient_for;
+
+ gdk_surface_get_origin (toplevel, &x, &y);
+ x += final_rect.x;
+ y += final_rect.y;
+
+ if (final_rect.width != surface->width ||
+ final_rect.height != surface->height)
+ {
+ gdk_x11_surface_move_resize (surface,
+ TRUE,
+ x, y,
+ final_rect.width, final_rect.height);
+ }
+ else
+ {
+ gdk_x11_surface_move (surface, x, y);
+ }
+}
+
+static void
+gdk_x11_surface_move_to_rect (GdkSurface *surface,
+ const GdkRectangle *rect,
+ GdkGravity rect_anchor,
+ GdkGravity surface_anchor,
+ GdkAnchorHints anchor_hints,
+ gint rect_anchor_dx,
+ gint rect_anchor_dy)
+{
+ gdk_surface_move_to_rect_helper (surface,
+ rect,
+ rect_anchor,
+ surface_anchor,
+ anchor_hints,
+ rect_anchor_dx,
+ rect_anchor_dy,
+ gdk_x11_surface_moved_to_rect);
+}
+
static void gdk_x11_surface_restack_toplevel (GdkSurface *surface,
GdkSurface *sibling,
gboolean above);
impl_class->restack_toplevel = gdk_x11_surface_restack_toplevel;
impl_class->move_resize = gdk_x11_surface_move_resize;
impl_class->toplevel_resize = gdk_x11_surface_toplevel_resize;
+ impl_class->move_to_rect = gdk_x11_surface_move_to_rect;
impl_class->get_geometry = gdk_x11_surface_get_geometry;
impl_class->get_root_coords = gdk_x11_surface_get_root_coords;
impl_class->get_device_state = gdk_x11_surface_get_device_state;